﻿<UserControl x:Class="SoftTeach.View.Jahrespläne.MonatsplanDetailView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase" 
             xmlns:resources="clr-namespace:SoftTeach.Resources" xmlns:jahrespläne="clr-namespace:SoftTeach.ViewModel.Jahrespläne"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
  <UserControl.Resources>
    <jahrespläne:ColorDataTemplateSelector x:Key="TagesplanColorDataTemplateSelector"/>
    <CollectionViewSource Source="{Binding Path=Tagespläne}" x:Key="TagespläneSorted">
      <CollectionViewSource.SortDescriptions>
        <scm:SortDescription PropertyName="TagesplanTagDesMonats" Direction="Ascending"/>
      </CollectionViewSource.SortDescriptions>
    </CollectionViewSource>
  </UserControl.Resources>
  <Grid>
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto"/>
      <RowDefinition Height="*"/>
    </Grid.RowDefinitions>
    <Label Grid.Row="0" Style="{StaticResource MonthHeader}" Content="{Binding Path=MonatsplanMonatstyp.MonatstypBezeichnung}" HorizontalContentAlignment="Center" />
    <ListBox Grid.Row="1"
           ItemsSource="{Binding Source={StaticResource TagespläneSorted}}"
           SelectedItem="{Binding Path=CurrentTagesplan, Mode=TwoWay}"  
           ItemTemplateSelector="{StaticResource TagesplanColorDataTemplateSelector}"
           HorizontalContentAlignment="Stretch" SelectionMode="Extended"
             ItemContainerStyle="{StaticResource NoBorderListBoxItemStyle }"/>
  </Grid>
</UserControl>
